import pdfplumber

# 打开pdf
with pdfplumber.open('TypeScript 极速梳理.pdf') as pdf:
    for i in pdf.pages: # 遍历页
        print(i.extract_text())  # 提取每页内容
        print(f'----------------第{i.page_number}页结束')